home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS14.ADF
/
Progs
/
VC.DOC
< prev
next >
Wrap
Text File
|
1989-01-28
|
7KB
|
200 lines
vc - spreadsheet calculator ("visicalc-like")
vc [file]
DESCRIPTION
'Vc' is a calculator that is based on rectangular tables, in much the
same style as VisiCalc or T/Maker. When it is invoked it presents you
with an empty table organised as rows and columns of entries. Each
entry may have a label string associated with it and an expression.
The expression may be a constant or it may compute something based on
other entries.
When 'vc' is running, the screen is divided into three regions: the
top line is for entering commands, the second line is for messages
from 'vc', and the rest form a window looking at the table. 'vc' has
two cursors: an entry cursor (indicated by a '<' on the screen) and a
character cursor (indicated by the terminal's hardware cursor). The
entry and character cursors are often the same, they will differ when
a long command is being typed in the top line.
The following single control character commands are recognized no
matter where the character cursor is.
^N Move the entry cursor to the next row.
^P Move the entry cursor to the previous row.
^F Move the entry cursor forward one column.
^B Move the entry cursor backward one column.
^C Exit from 'vc'. If you were editing a named file, and you modified
it, then it will ask about saving before exiting.
^G Abort the current long command.
^H Backspace one character.
^L Propagate values around the screen. A complicated set of rows and
columns may require more than one ^L to stabilize.
^R Redraw the screen.
^J Creates a new row immediately following the current row. It is
initialized to be a copy of the current row, with all variable
references moved down one row. If an expression is to be duplicated
with ^J the moving down of a variable reference may be avoided by
using the "fixed" operator.
^V Types, in the long command line, the name of the entry being
pointed at by the entry cursor. This is used when typing in
expressions to refer to entries in the table.
^U n Sets the numeric argument to the following command to 'n'.
Commands like ^F and ^B use the numeric argument as the number of
times to perform the operation. If you aren't entering a long command
then the ^U is unnecessary: repetition count arguments may be entered
just as a string of digits.
The following commands are only valid when the character and entry
cursors are the same. That is, when no long command is being entered.
Most of them introduce a new long command.
= Prompts for an expression which will be evaluated dynamically to
produce a value for the entry pointed at by the entry cursor. This
may be used in conjunction with ^V to make one entries value be
dependent on anothers.
C Clears the current entry as if there were none.
? Types a brief helpful message.
" Enter a label for the current entry.
e Edit the value associated with the current entry. This is identical
to '=' except that the command line starts out containing the old
value or expression associated with the entry.
E Edit the string associated with the current entry. This is the same
as either "leftstring", "rightstring", or "label", with the additional
fact that the command line starts out with the old string.
< Associate a string with this entry that will be flushed left against
the left edge of the entry.
> Associates a string with this entry that will be flushed right
against the right edge of the entry.
g Get a new database from a named file.
p Put the current database onto a named file.
w Write a listing of the current database in a form that matches its
appearance on the screen. This differs from the "put" command in that
"put"s files are intended to be reloaded with "get", while "write"
produces a file for people to look at.
T Write a listing of the current database to a file, but put ":"s
between each field. This is useful for tables that will be further
formatted by the 'tbl' preprocessor of 'nroff'.
f Sets the output format to be used for printing the numbers in each
entry in the current column. Type in two numbers which will be the
width in characters of a column and the number of digits which will
follow the decimal point.
r Create a new row by moving the row containing the entry cursor, and
all following, down one. The new row will be empty.
c Create a new column by moving the column containing the entry
cursor, and all following, right one. The new column will be empty.
d Delete this row.
D Delete this column.
C Clear this entry.
Expressions that are used with the '=' and 'e' commands have a fairly
conventional syntax. Terms may be variable names (from the ^V
command), parenthesised expressions, negated terms, and constants.
The +/ term sums values in rectangular regions of the table (the
notation +/ is reminiscent of apl's additive reduction.) Terms may be
combined using many binary operators. Their precedences (from highest
to lowest) are: *,/; +,-; <,=,>,<=,>=; &; |; ?.
exec("progname",arg1,...,argn)
Start a Bourne shell with "progname" and arg1 through argn as
arguments. The args can be arbitrary vc expressions. The output of
progname is converted to a floating point number and the result is
returned as the value of exec.
e+e Addition.
e-e Subtraction.
e*e Multiplication.
e/e Division.
+/v:v Sum all valid (nonblank) entries in the region whose two corners
are defined by the two variable (entry) names given.
e?e:e Conditional: If the first expression is true then the value of
the second is returned, otherwise the value of the third is.
<,=,>,<=,>= Relationals: true iff the indicated relation holds.
&,| Boolean connectives.
To make a variable not change automatically when a row is duplicated
with ^J, put the word 'fixed' in front of it. I.e.
r2c1*fixed r3c1
Amiga Modifications
I have added a few changes, and plan others, to 'vc' to make it more
useable on the Amiga.
The four cursor movement keys can be used to move the cursor around
instead of using ^P,^N,^F, and ^B.
The cursor character '<' is also displayed in colour.
Authors
James Gosling wrote the original version. It was later modified by
Mark Weiser and Bruce Israel. Peter Hardie then ported it to the
Amiga and is currently working on adding some more enhancements so
that the program will make effective use of the mouse and menus.
FILES
expense.sc - a sample expense report.
apartments.sc - another example file.
SEE ALSO
The Unix commands bc(1) and dc(1). The VisiCalc or T/Maker manuals.
BUGS
There should be a */ operator.
Expression reevaluation is done in the same top-to-bottom,
left-to-right manner as is done in other spreadsheet calculators.
This is silly. A proper following of the dependency graph with
(perhaps) recourse to relaxation should be implemented.
At most 100 rows and 40 columns.